/*

Author   : chaos

FileName : cast.cpp

Date     : 07/08/17 16:32:26

*/
#include <iostream>
using namespace std;

int main(void)
{

    int i = 10;
    int * ptr_i = &i;
    double * ptr_d;

    ptr_d = reinterpret_cast<double *>(ptr_i);

    cout << "ptr_i = " << ptr_i << endl;
    cout << "*ptr_i = " << *ptr_i << endl << endl;

    cout << "ptr_d = " << ptr_d << endl;
    cout <<"*ptr_d = " << *ptr_d << endl;
    cout << "*((int*)ptr_d) = " << *((int *)ptr_d) << endl << endl;

    cout << "sizeof(*ptr_i) = " << sizeof(*ptr_i) << endl;
    cout << "sizeof(*ptr_d) = " << sizeof(*ptr_d) << endl;

    return 0;
}
